<?php
namespace app\serveradv\validate;
use app\manage\validate\BaseValidate;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2017/7/15
 * Time: 16:24
 */
class AdvClassify extends BaseValidate
{
    protected $rule = [
        'pid'         => ['integer', 'egt'=>0],
        'name'        => ['length'=>'2,10'],
        'app_id'      => ['integer', 'gt'=>0],
        'add_user_id' => ['integer', 'min'=>1],
        'id'          => ['integer', 'gt'=>0],
        'page'        => ['integer', 'gt'=>0],
        'listRows'    => ['integer', 'gt'=>0],
    ];

    protected $message = [
        'add_user_id.integer' => 'add_user_id只能填写数字'
    ];

    protected $scene = [
        'addAdvClassify'       => ['pid', 'name', 'app_id', 'add_user_id'],
        'gainAdvClassifyList'  => [],
        'editAdvClassify'      => ['id'],
        'enableAdvClassify'    => ['id'],
        'disableAdvClassify'   => ['id'],
        'deleteAdvClassify'    => ['id'],
        'advClassifySomeList'  => ['pid','app_id'],
        'advClassifyCondition' => ['page','listRows'],
    ];
}